<template>
  <div class="" id="aaa">
    compToHtml
    <MyPanel v-if="flagRef"></MyPanel>
  </div>
</template>

<script setup>
import Vue from 'vue'
import {onMounted} from 'vue'
import MyPanel from './comp/MyPanel.vue'
import aImg from '@/assets/images/a.png?inline'

const flagRef = ref(false)

console.log('import.meta', import.meta);
console.log(aImg);
// 路由
const modules = import.meta.glob('./comp/MyPanel.vue');

console.log('modules', modules);
console.log('MyPanel', MyPanel);

onMounted(() => {
  test2()
})

function test2() {
  debugger
  console.log('MyPanel 2', MyPanel);
  const vueObj = Vue.extend(MyPanel)
  const onePanel = new vueObj()
  // $mound() 方法执行之后，才会生成 $el，即创建dom 节点，视图和方法关联
  onePanel.$mount()
  console.log(onePanel.$el)

  document.getElementById("aaa").append(onePanel.$el)
}

</script>

<style scoped lang="scss">
</style>
